﻿Imports System.ComponentModel
Imports DevExpress.LookAndFeel
Imports System.Linq
Imports DevExpress.XtraReports.UI
Imports DevExpress.XtraReports.Parameters


Public Class fROrcamentoProjectos
    Public arm As String
    Dim db As New lqProjectosDataContext

    Sub New()
        InitSkins()
        ' This call is required by the designer.
        InitializeComponent()

        ' Add any initialization after the InitializeComponent() call.

    End Sub
    Sub InitSkins()
        DevExpress.Skins.SkinManager.EnableFormSkins()
        DevExpress.UserSkins.BonusSkins.Register()
        UserLookAndFeel.Default.SetSkinStyle("Metropolis")
    End Sub

    Private Sub SimpleButton1_Click(sender As Object, e As EventArgs) Handles SimpleButton1.Click
        If ComboBoxEdit1.Text Is Nothing Then

        Else

            Me.RProjectosTableAdapter1.Fill(DsProjectos1.RProjectos, ComboBoxEdit1.Text, GlobalVariables.Empresa)

            Dim Report As New ROrcamentoProjectos

            Report.RequestParameters = False

            Report.DataAdapter = Me.RProjectosTableAdapter1
            ' Bind the report's printing system to the print control. 
            PrintControl1.PrintingSystem = Report.PrintingSystem


            ' Generate the report's print document. 
            Report.CreateDocument()
        End If
    End Sub

    Private Sub fROrcamentoUNGeral1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Dim a = (From c In db.tblProjectos _
              Group c By c.ano Into Group _
              Select ANO)


        For Each ano In a
            ComboBoxEdit1.Properties.Items.Add(ano.ToString)
        Next
    End Sub
End Class